<!DOCTYPE html>
<!-- 作者: lauJinyu -->
<html lang="zh-CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>快手授权 - H5页面</title>
    <style>
        body {
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            margin: 0;
            padding: 20px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            min-height: 100vh;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .auth-container {
            background: white;
            border-radius: 20px;
            padding: 40px;
            box-shadow: 0 20px 40px rgba(0,0,0,0.1);
            text-align: center;
            max-width: 400px;
            width: 100%;
        }
        .logo {
            width: 80px;
            height: 80px;
            background: #ff6b35;
            border-radius: 50%;
            margin: 0 auto 20px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 36px;
            color: white;
        }
        h1 {
            color: #333;
            margin: 20px 0;
            font-size: 24px;
        }
        .app-info {
            background: #f8f9fa;
            padding: 15px;
            border-radius: 10px;
            margin: 20px 0;
            color: #666;
            font-size: 14px;
        }
        .auth-btn {
            background: linear-gradient(45deg, #ff6b35, #f7931e);
            color: white;
            border: none;
            padding: 15px 30px;
            border-radius: 25px;
            font-size: 16px;
            font-weight: bold;
            cursor: pointer;
            width: 100%;
            margin: 20px 0;
            transition: all 0.3s ease;
            text-decoration: none;
            display: inline-block;
            box-sizing: border-box;
        }
        .auth-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 10px 20px rgba(255, 107, 53, 0.3);
        }
        .info-text {
            color: #888;
            font-size: 12px;
            line-height: 1.5;
            margin-top: 20px;
        }
    </style>
</head>
<body>
    <div class="auth-container">
        <div class="logo">🎬</div>
        <h1>快手授权</h1>
        <div class="app-info">
            应用ID: <span th:text="${appId}"></span>
        </div>
        <p>点击下方按钮授权，获得发布视频权限</p>
        <a th:href="${authorizeUrl}" class="auth-btn">开始授权</a>
        <div class="info-text">
            授权后将跳转回本应用，并获得视频发布权限。<br>
            请确保在快手官方页面完成授权流程。
        </div>
    </div>

    <script>
        // 前端JS增强：可以在这里添加授权状态检查、错误处理等逻辑
        console.log('快手授权页面已加载，appId:', '[[${appId}]]');
        
        // 检查是否有授权成功的回调参数
        const urlParams = new URLSearchParams(window.location.search);
        if (urlParams.get('auth_success') === 'true') {
            alert('授权成功！现在可以发布视频了。');
        }
    </script>
</body>
</html>